package combinations;

import java.util.Arrays;
import java.util.List;

import utils.Util;

public class RawCombinations implements Combinations{

	
	public List<List<Integer>> getCombinations(int n) {
		Integer[] firstNIntegers = Util.getFirstNIntegers(n);
		List<Integer> listOfFirstNIntegers = Arrays.asList(firstNIntegers);
		List<List<Integer>> combinations = Combination.findCombinations(listOfFirstNIntegers);
		return combinations;
	}	
	
	/*
	public static  List<List<Integer>> getCombinations(int n, int k) {
		Integer[] firstNIntegers = Util.getFirstNIntegers(n);
		List<Integer> listOfFirstNIntegers = Arrays.asList(firstNIntegers);
		List<List<Integer>> combinations = Combination.findCombinations(listOfFirstNIntegers, k);
		return combinations;
	}
	*/	
	
	public List<List<Integer>> getCombinationsUpToSize(int n, int k) {
		//if(k > n) throw new IllegalArgumentException("cannot have more variables in a disjunction"
		//		+ " than number of categories in an ascriptive attribute:\n" + k + " must be smaller than " + n);
		Integer[] firstNIntegers = Util.getFirstNIntegers(n);
		List<List<Integer>> combinations = null;
		for(int i = 1; i < k && i <= n; i++){
			List<Integer> listOfFirstNIntegers = Arrays.asList(firstNIntegers);
			if(combinations == null) {
				combinations = Combination.findCombinations(listOfFirstNIntegers, i);
			} else{
				combinations.addAll(Combination.findCombinations(listOfFirstNIntegers, i));
			}
		}
		/*
		if(negationsAllowed)
			for(int i = n; i > n - k && i >= 1; i--){
				List<Integer> listOfFirstNIntegers = Arrays.asList(firstNIntegers);
				if(combinations == null) {
					combinations = Combination.findCombinations(listOfFirstNIntegers, i);
				} else{
					combinations.addAll(Combination.findCombinations(listOfFirstNIntegers, i));
				}
			}		
		*/
		return combinations;
	}	
	
}
